package com.atguigu.srb.common.exception;

import com.atguigu.srb.common.result.ResponseEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * ClassName: SrbException
 * Package: com.atguigu.srb.common.exception
 * Description:
 *
 * @Author 王晓龙
 * @Create 2023/3/27 6:35
 * @Version 1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SrbException extends RuntimeException {
    private Integer code;
    private String message;

    public SrbException(ResponseEnum responseEnum){
        this.code = responseEnum.getCode();
        this.message = responseEnum.getMessage();
    }
}
